package com.koicarp.agent.provider.enums;

import com.koicarp.agent.common.enums.BaseEnum;
import lombok.Getter;

/**
 * @ClassName:  SliceTypeEnum   
 * @Description: 切分类型枚举  
 * @author: liutao
 * @date:   2025年3月4日 上午11:27:27    
 */
@Getter
public enum SliceTypeEnum implements BaseEnum {
	
	/**
	 * 字符
	 */
	CHAR(3, "字符切分", 10, 2),
	
	/**
	 * 段落
	 */
	PARAGRAPH(1, "分段切分", 50, 10),
	
	/**
	 * 自定义
	 */
	CUSTOMER(2, "自定义切分", 30, 5);
	
	private SliceTypeEnum(Integer value, String desc, Integer maxSegmentSize, Integer maxOverlapSize) {
		this.value = value;
		this.desc = desc;
		this.maxSegmentSize = maxSegmentSize;
		this.maxOverlapSize = maxOverlapSize;
	}
	
	private final Integer value;
	
	private final String desc;
	
	private final Integer maxSegmentSize;
	
	private final Integer maxOverlapSize;
	
	public static SliceTypeEnum getSliceEnumByType(Integer type) {
		SliceTypeEnum[] values = SliceTypeEnum.values();
		for (SliceTypeEnum sliceTypeEnum : values) {
			if(sliceTypeEnum.getValue().equals(type)) {
				return sliceTypeEnum;
			}
		}
		
		return null;
	}
	
}
